<include file="public@header"/>
<style>html{background-color: #ffffff}</style>
</head>
<body>
<div class="layui-row js-check-wrap">
    <div class="layui-side" style="background: #f5f7f9;">
        <ul class="layui-if-menu">
            <li class="layui-this"><i class="icon-icon layui-icon-md-filing"></i><a href="{:url('SlideItem/index',['slide_id'=>$slide_id])}">幻灯片列表</a></li>
            <li><i class="icon-icon layui-icon-md-add-circle"></i><a href="{:url('SlideItem/add',['slide_id'=>$slide_id])}">添加幻灯片</a></li>
        </ul>
    </div>
    <div class="layui-body" style="padding: 15px 25px 0 15px;">
        <div class="layui-tab-item layui-show">
            <form method="post" class="layui-form js-ajax-form" action="{:url('SlideItem/listOrder')}">
                <div class="layui-btn-container">
                    <button class="layui-btn layui-btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
                </div>
                <php>
                    $status = [
                    '隐藏',
                    '开启'
                    ];
                </php>
                <table class="layui-table" lay-even lay-size="lg">
                    <thead>
                    <tr>
                        <th width="50">{:lang('SORT')}</th>
                        <th width="50">ID</th>
                        <th>幻灯片标题</th>
                        <th>描述</th>
                        <th>图片</th>
                        <th>状态</th>
                        <th width="176">{:lang('ACTIONS')}</th>
                    </tr>
                    </thead>
                    <tbody>
                    <foreach name="result" item="vo">
                        <tr>
                            <td>
                                <input name="list_orders[{$vo.id}]" class="input-order" type="text" value="{$vo.list_order}" style="width: 50px">
                            </td>
                            <td>{$vo.id}</td>
                            <td>{$vo.title}</td>
                            <td>{$description = mb_substr($vo['description'], 0, 48,'utf-8')}</td>
                          
                            <td>
                                <if condition="!empty($vo['image'])">
                                    <a href="javascript:admin.imagePreviewDialog('{:cmf_get_image_preview_url($vo.image)}');">
                                        <i class="icon-icon layui-icon-md-images"></i>
                                    </a>

                                </if>
                            </td>
                            <td>
                                <empty name="vo.status">
                                    <span class="layui-badge-dot layui-bg-abnormal" style="margin-right: 6px;"></span>{$status[$vo['status']]}
                                    <else/>
                                    <span class="layui-badge-dot layui-bg-function" style="margin-right: 6px;"></span>{$status[$vo['status']]}
                                </empty>
                            </td>
                            <td>
                                <a class="layui-bo layui-bo-small layui-bo-checked" href="{:url('SlideItem/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                                <div class="new-divider new-divider-vertical"></div>
                                <a href="{:url('SlideItem/delete',array('id'=>$vo['id']))}"
                                   class="layui-bo layui-bo-small layui-bo-close js-ajax-delete">{:lang('DELETE')}</a>
                                <div class="new-divider new-divider-vertical"></div>
                                <if condition="empty($vo['status']) eq 1">
                                    <a href="{:url('SlideItem/cancelban',array('id'=>$vo['id'],'slide_id'=>$vo['slide_id']))}" class="layui-bo layui-bo-small layui-bo-succes js-ajax-dialog-btn"
                                       data-msg="确定显示此幻灯片吗？">{:lang('DISPLAY')}</a>
                                    <else/>
                                    <a href="{:url('SlideItem/ban',array('id'=>$vo['id'],'slide_id'=>$vo['slide_id']))}" class="layui-bo layui-bo-small layui-bo-waring js-ajax-dialog-btn"
                                       data-msg="确定隐藏此幻灯片吗？">{:lang('HIDE')}</a>
                                </if>
                            </td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </form>
        </div>
    </div>
</div>
<include file="public@script"/>
</body>
</html>